<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title> 字体大小</title>
    <style type="text/css" media="screen">
    	#box{
    		font-size: 16px;
    	}
    </style>
</head>
<body>
	字体大小：<input id="btn1" type="text" name="" value="">
	<input id="btn2" type="button" name="确定" value="确定">	
	<div id="box">123</div>
</body>
<script type="text/javascript">
	var btn1 = document.getElementById("btn1");
	var btn2 = document.getElementById("btn2");
	var box = document.getElementById("box");
	var a = 0;
	btn1.value = a + "px";	
	btn2.onclick = function(){
		var val = btn1.value;
                     box.style.fontSize = val; 
	}
</script>
<html>
